package com.example.controller;


import com.example.entity.Student;
import com.example.service.StudentService;
import com.example.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("student")
public class StudentController {
  @Autowired
  private StudentService studentService;
    @RequestMapping("login")
    public JsonResult<Student> login(String username, String password){
        System.out.println(username+password);
        Student date = studentService.login(username, password);

//        System.out.println(getuidFromSession(session));
//        System.out.println(getUsernameFromSession(session));
        return new JsonResult<Student>(200,date);
    }

}
